<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    通过构造函数创建对象实例，该对象实例能够计算圆的周长和面积，固定属性是圆的半径
</body>

</html>
<script>
    function circle(r) {
        this.r = r;
        this.mj = () => {
            return Math.PI * this.r * this.r;
        };
        this.zc = () => {
            return 2 * Math.PI * this.r
        };
    }
    let c = new circle(1)
    console.log(c.mj());
    console.log(c.zc());
</script>